const Sequelize = require('sequelize')
const db = require('../db.js')

const Company = db.define(
  'Company',
  {
    id: { type: Sequelize.INTEGER, primaryKey: true, allowNull: false, autoIncrement: true },
    name: { type: Sequelize.STRING, allowNull: false },
    address: { type: Sequelize.STRING, allowNull: false },
    tel: { type: Sequelize.STRING, allowNull: false },
    //公司介绍
    intro: { type: Sequelize.TEXT, allowNull: false },
    //经度
    longitude: { type: Sequelize.DECIMAL, allowNull: false },
    //维度
    latitude: { type: Sequelize.DECIMAL, allowNull: false },
  },
  {
    //是否允许驼峰命名
    underscored: true,
    //表的名称
    tableName: 'company',
  }
)
module.exports = Company
